<!DOCTYPE html>
<html ng-app="myApp" ng-controller="MainCtrl">
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../购物车/js/jquery-1.11.2.min.js" ></script>
		<script type="text/javascript" src="../js/angular.js" ></script>
	</head>
	<body>
		<script>
var myApp = angular.module('myApp', []);
        myApp.controller('MainCtrl', ['$scope','$compile',function($scope, $compile) {
            $scope.count = 0;
            $scope.add = function() {
              if(event.target.tagName.toLowerCase()=="input")return;
                var target=$(event.target);
                $scope.count++;
                target.html($compile("<input  value='"+$scope.count+"' ng-blur='showValue()'>")($scope));
            }
            $scope.showValue=function(){
                alert(event.target.value)
            }
        }])
			
		</script>
	</body>
</html>
